<%@ page import="minusjudge.Contest" %>



<div class="fieldcontain ${hasErrors(bean: contestInstance, field: 'title', 'error')} required">
	<label for="title">
		<g:message code="contest.title.label" default="Title" />
		<span class="required-indicator">*</span>
	</label>
	<g:textField name="title" required="" value="${contestInstance?.title}"/>
</div>

<div class="fieldcontain ${hasErrors(bean: contestInstance, field: 'startTime', 'error')} required">
	<label for="startTime">
		<g:message code="contest.startTime.label" default="Start Time" />
		<span class="required-indicator">*</span>
	</label>
	<g:datePicker name="startTime" precision="day"  value="${contestInstance?.startTime}"  />
</div>

<div class="fieldcontain ${hasErrors(bean: contestInstance, field: 'endTime', 'error')} required">
	<label for="endTime">
		<g:message code="contest.endTime.label" default="End Time" />
		<span class="required-indicator">*</span>
	</label>
	<g:datePicker name="endTime" precision="day"  value="${contestInstance?.endTime}"  />
</div>

<div class="fieldcontain ${hasErrors(bean: contestInstance, field: 'admins', 'error')} ">
	<label for="admins">
		<g:message code="contest.admins.label" default="Admins" />
		
	</label>
	
<ul class="one-to-many">
<g:each in="${contestInstance?.admins?}" var="a">
    <li><g:link controller="contestAdminister" action="show" id="${a.id}">${a?.encodeAsHTML()}</g:link></li>
</g:each>
<li class="add">
<g:link controller="contestAdminister" action="create" params="['contest.id': contestInstance?.id]">${message(code: 'default.add.label', args: [message(code: 'contestAdminister.label', default: 'ContestAdminister')])}</g:link>
</li>
</ul>

</div>

<div class="fieldcontain ${hasErrors(bean: contestInstance, field: 'clarifications', 'error')} ">
	<label for="clarifications">
		<g:message code="contest.clarifications.label" default="Clarifications" />
		
	</label>
	
<ul class="one-to-many">
<g:each in="${contestInstance?.clarifications?}" var="c">
    <li><g:link controller="clarification" action="show" id="${c.id}">${c?.encodeAsHTML()}</g:link></li>
</g:each>
<li class="add">
<g:link controller="clarification" action="create" params="['contest.id': contestInstance?.id]">${message(code: 'default.add.label', args: [message(code: 'clarification.label', default: 'Clarification')])}</g:link>
</li>
</ul>

</div>

<div class="fieldcontain ${hasErrors(bean: contestInstance, field: 'contestants', 'error')} ">
	<label for="contestants">
		<g:message code="contest.contestants.label" default="Contestants" />
		
	</label>
	
<ul class="one-to-many">
<g:each in="${contestInstance?.contestants?}" var="c">
    <li><g:link controller="contestant" action="show" id="${c.id}">${c?.encodeAsHTML()}</g:link></li>
</g:each>
<li class="add">
<g:link controller="contestant" action="create" params="['contest.id': contestInstance?.id]">${message(code: 'default.add.label', args: [message(code: 'contestant.label', default: 'Contestant')])}</g:link>
</li>
</ul>

</div>

<div class="fieldcontain ${hasErrors(bean: contestInstance, field: 'problems', 'error')} ">
	<label for="problems">
		<g:message code="contest.problems.label" default="Problems" />
		
	</label>
	
<ul class="one-to-many">
<g:each in="${contestInstance?.problems?}" var="p">
    <li><g:link controller="problem" action="show" id="${p.id}">${p?.encodeAsHTML()}</g:link></li>
</g:each>
<li class="add">
<g:link controller="problem" action="create" params="['contest.id': contestInstance?.id]">${message(code: 'default.add.label', args: [message(code: 'problem.label', default: 'Problem')])}</g:link>
</li>
</ul>

</div>

<div class="fieldcontain ${hasErrors(bean: contestInstance, field: 'rootPath', 'error')} ">
	<label for="rootPath">
		<g:message code="contest.rootPath.label" default="Root Path" />
		
	</label>
	<g:textField name="rootPath" value="${contestInstance?.rootPath}"/>
</div>

